<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateArticlePoolsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('article_pools', function (Blueprint $table) {
            $table->id();
            $table->string('title')->default('')->comment('标题');
            $table->longText('content')->comment('内容');
            $table->smallInteger('source')->default(0)->comment('来源');
            $table->string('source_id')->default('')->comment('来源平台的文章ID');
            $table->string('source_url', 1024)->default('')->comment('摘要');
            $table->timestamps();
            $table->softDeletes();

            $table->unique(['source', 'source_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('article_pools');
    }
}
